import java.lang.*;

public class BinarySearchTest {
    public static void main(String[] args) {
        BinarySearch binSearch = new BinarySearch();
        int [] someList = new int [50];
        int temp;
        for (int i = 0; i < someList.length; i++) {
            someList[i] = (int)(Math.random() * 100);
        }
        sortList(someList);
        System.out.println(binSearch.binarySearch(someList, 45));
    }
    
    public static void sortList(int [] list) {
        int temp;
        boolean flag = true;
        int j = 0;
        while(flag) {
            flag = false;
            j++;
            for (int i = 0; i < list.length - j; i++) {
                if(list[i] > list[i + 1]) {
                    temp = list[i];
                    list[i] = list[i + 1];
                    list[i + 1] = temp;
                    flag = true;
                }
            }
        }
    }
}
